<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message"/>
     <style type="text/css">
        .ecol1 { vertical-align: top; padding-right : 25px }
        .ecol2 { vertical-align: top; border-left: #ACBECE 1px solid; padding-left : 10px }
        .rich-calendar-tool-btn{
            font-family: Arial, Verdana;
        } 
    </style>
    
    
    <h:form id="cabineForm">

        <rich:panel>
            <f:facet name="header">Cabine</f:facet>
    
            <s:decorate id="numeroDecoration" template="layout/edit.xhtml">
                <ui:define name="label">Numero</ui:define>
                <h:inputText id="name" required="true"
                             value="#{cabineHome.instance.numero}"/>
            </s:decorate>
            
            <s:decorate id="tipoClasseDecoration" template="layout/edit.xhtml">
            <ui:define name="label">Classe</ui:define>
			<h:selectOneMenu value="#{cabineHome.instance.tipoClasse}">
				<s:selectItems var="classe" label="#{classe.descricao}"
					value="#{classes}">
					</s:selectItems>
				<s:convertEnum></s:convertEnum>
			</h:selectOneMenu>
            </s:decorate>
            
            <s:decorate id="navioDecoration" template="layout/edit.xhtml">
                <ui:define name="label">Navio</ui:define>
                <h:selectOneMenu value="#{cabineHome.instance.navio}">
					<s:selectItems noSelectionLabel="Selecione.." value="#{navioList.resultList}" var="navio_" label="#{navio_.nome}">
						</s:selectItems>
					<s:convertEntity />
				</h:selectOneMenu>
            </s:decorate>
            
            <div style="clear:both"/>
            
        </rich:panel>

        <div class="actionButtons">
            <h:commandButton id="save" 
                          value="Salvar" 
                         action="#{cabineHome.persist}"
                       rendered="#{!cabineHome.managed}"/>                   
            <h:commandButton id="update" 
                          value="Salvar" 
                         action="#{cabineHome.update}"
                       rendered="#{cabineHome.managed}"/>                  
            <h:commandButton id="delete" 
                          value="Excluir" 
                         action="#{cabineHome.remove}"
                      immediate="true"
                       rendered="#{cabineHome.managed}"/>
            <s:button propagation="end" 
                               id="done" 
                            value="Voltar"
                             view="/cabineList.xhtml"/>
        </div>
        
    </h:form>
    
</ui:define>

</ui:composition>

